<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('【请填写功能名称】列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>驾驶员：</label>
                            <input type="text" name="driverName"/>
                        </li>
                        <li>
                            <label>部门：</label>
                            <input type="text" name="Department"/>
                        </li>
                        <li>
                            <label>职位：</label>
                            <input type="text" name="Position"/>
                        </li>
                        <li>
                            <label>请假日期：</label>
                            <input type="text" class="time-input" placeholder="请选择请假日期" name="LeaveDate"/>
                        </li>
                        <li>
                            请假类型：<select name="LeaveType" th:with="type=${@dict.getType('sys_leave_type')}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                        </li>
                        <li>
                            <label>请假时长：</label>
                            <input type="text" name="LeaveDuration"/>
                        </li>
                        <li>
                            <label>审批人：</label>
                            <input type="text" name="Approver"/>
                        </li>
                        <li>
                            审批状态：<select name="ApprovalStatus" th:with="type=${@dict.getType('sys_leave_status')}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                        </li>
                        <li>
                            <label>审批日期：</label>
                            <input type="text" class="time-input" placeholder="请选择审批日期" name="ApprovalDate"/>
                        </li>
                        <li>
                            是否需要替班：<select name="Substitute" th:with="type=${@dict.getType('sys_leave_substitute')}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                        </li>
                        <li>
                            <label>流程id：</label>
                            <input type="text" name="Lid"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:leaverequest:add">
                <i class="fa fa-plus"></i> 添加
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:leaverequest:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:leaverequest:remove">
                <i class="fa fa-remove"></i> 删除
            </a>
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:leaverequest:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:leaverequest:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:leaverequest:remove')}]];
    var prefix = ctx + "system/leaverequest";
    var types = [[${@dict.getType('sys_leave_type')}]];
    var statuss = [[${@dict.getType('sys_leave_status')}]];
    var substitutes = [[${@dict.getType('sys_leave_substitute')}]];

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "【请填写功能名称】",
            columns: [{
                checkbox: true
            },
                {
                    field: 'driverID',
                    title: '驾驶员ID',
                    visible: false
                },
                {
                    field: 'driverName',
                    title: '驾驶员姓名'
                },
                {
                    field: 'driverLicense',
                    title: '驾驶证号码'
                },
                {
                    field: 'vehicleType',
                    title: '驾驶车型'
                },
                {
                    field: 'experienceYears',
                    title: '驾龄'
                },
                {
                    field: 'contactInfo',
                    title: '联系方式'
                },
                {
                    field: 'comments',
                    title: '备注'
                },
                {
                    field: 'status',
                    title: '状态'
                },
                {
                    field: 'flowInstantId',
                    title: '流程id',
                    visible: false
                },
                {
                    field: 'agree',
                    title: '是否同意',
                    visible: false
                },
                {
                    field: 'comment',
                    title: '批注',
                },

                {
                    field: 'picture',
                    title: '图片'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.driverID + '\')"><i class="fa fa-edit"></i>审核</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>